﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace TM.QWeibo.Client.UserControls
{
    public partial class ProfileInfo : UserControl
    {
        public ProfileInfo()
        {
            InitializeComponent();
        }

        public Action<int> BlockClicked;

        /// <summary>
        /// 绑定用户信息
        /// </summary>
        /// <param name="userInfo"></param>
        public void BindInfo(SDK.Objects.UserInfo userInfo)
        {

            Dispatcher.BeginInvoke(() =>
            {
                ProfileInfoLayoutRoot.DataContext = userInfo;
            });
        }

        private void Grid_Tap(object sender, GestureEventArgs e)
        {
            if(BlockClicked!=null)
            {
                var tag = (string)((Grid) sender).Tag;
                BlockClicked(int.Parse(tag));
            }
        }
    }
}
